#pragma once
#include"RBTree.h"

namespace zjy
{
	template<class K>
	class set
	{
		class SetKeyOfT
		{
		public:
			const K& operator ()(const K& k)
			{
				return k;
			}
		};
	public:
		typedef typename RBTree< K, const K, SetKeyOfT> ::iterator iterator;
		typedef typename RBTree< K,  K, SetKeyOfT> ::const_iterator const_iterator;

		iterator begin()
		{
			return _t.begin();
		}
		iterator end()
		{
			return _t.end();
		}
		const_iterator begin()const
		{
			return _t.begin();
		}
		const_iterator end()const
		{
			return _t.end();
		}


		pair<iterator,bool> insert(const K& key )
		{
			return _t.Insert(key);
		}
		iterator find(const K& key)const
		{
			return _t.Find(key);
		}
		void inorder()const
		{
			_t.Inorder();
		}

		bool empty()const
		{
			return _t.Empty();
		}
		size_t size()const
		{
			return _t.Size();
		}

	private:
		RBTree<K, const K, SetKeyOfT> _t;
	};
}
